import React, {Component} from 'react';
import { Switch, Route} from 'react-router-dom';
import MyNavLink from '../../components/MyNavLink/MyNavLink';
import Message from './Message';
import News from './News';

export default class Home extends Component {
	// 嵌套路由子路由需要和父路由相同
	render() {
		return (
			<div>
				<h2>Home组件内容</h2>
				<div>
					<ul className="nav nav-tabs">
						<li>
							<MyNavLink to="/home/news">News</MyNavLink>
						</li>
						<li>
							<MyNavLink to="/home/message">message</MyNavLink>
						</li>
					</ul>
					<Switch>
						<Route path="/home/news" component={News} />
						<Route path="/home/message" component={Message} />
						{/* <Redirect to="/about" /> */}
					</Switch>
				</div>
			</div>
		);
	}
}
